package com.tedu.egweibo2.result;

import lombok.Data;

@Data
public class JsonResult {
    private Integer statusCode;
    private String message;
    private Object data;

    public JsonResult(){

    }
    public JsonResult(StatusCode statusCode){
        this.statusCode=statusCode.getStatusCode();
        this.message=statusCode.getMessage();
    }
    public JsonResult(StatusCode statusCode,Object data){
        /*this.statusCode=statusCode;
        this.message=message;*/
        this(statusCode);
        this.data = data;

    }

    public static JsonResult success(Object data){
        return new JsonResult(StatusCode.OPERATION_SUCCESS,data);

    }
    public static JsonResult success(){
        return JsonResult.success(null);
    }

}
